﻿@model FantasyDraft2.Models.MatchupViewModel

@{
    ViewBag.Title = "Index";
}

<h2>Setup Game</h2>
@using (Html.BeginForm())
{
    <div>
        <b>@Model.message</b>
    </div>
    <table>
        <tr>
            <td>Team One
            </td>
            <td>Team Two
            </td>
        </tr>
        <tr>
            <td>
                @Html.DropDownListFor(
                    x => x.TeamIdOne,
                    new SelectList(Model.teams, "TeamId", "TeamName"))
            </td>
            <td>
                @Html.DropDownListFor(
                    x => x.TeamIdTwo,
                    new SelectList(Model.teams, "TeamId", "TeamName"))
            </td>
            <td>
                <input type="submit" value="Go" />
            </td>
        </tr>
    </table>
    if (Model.oneresults.Count > 0)
    {
    <table>
        <tr>
            <td>
                <div>
                    <b>Team One</b>
                </div>
                <table>
                    <tr>
                        <th>Player
                        </th>
                        <th>Goals
                        </th>
                        <th>Assists
                        </th>
                        <th>Total Score
                        </th>
                    </tr>

                    @foreach (FantasyDraft2.Models.MatchupResultModel mymodel in Model.oneresults)
                    {
                        <tr>
                            <td>@mymodel.player.Name</td>
                            <td>@mymodel.game.Goals</td>
                            <td>@mymodel.game.Assists</td>
                            <td>@mymodel.totalscore</td>
                        </tr>
                    }
                </table>
            </td>
            <td>
                &nbsp;&nbsp;&nbsp;
            </td>
            <td>
                <div>
                    <b>Team Two</b>
                </div>
                <table>
                    <tr>
                        <th>Player
                        </th>
                        <th>Goals
                        </th>
                        <th>Assists
                        </th>
                        <th>Total Score
                        </th>
                    </tr>

                    @foreach (FantasyDraft2.Models.MatchupResultModel mymodel in Model.tworesults)
                    {
                        <tr>
                            <td>@mymodel.player.Name</td>
                            <td>@mymodel.game.Goals</td>
                            <td>@mymodel.game.Assists</td>
                            <td>@mymodel.totalscore</td>
                        </tr>
                    }
                </table>
            </td>
        </tr>
    </table>
    }
}

